package com.fjec.common.ys.protocol;

import org.apache.commons.collections.MapUtils;

import java.util.HashMap;
import java.util.Map;

public class ResGetUploadToken extends HashMap<String, Object> {

    private final static String DATA_KEY = "ysepay_merchant_register_token_get_response";

    private final static String TOKEN_KEY = "token";

    private final static String TOKEN_STATUS_KEY = "token_status";

    public String getSign() {
        return MapUtils.getString(this, YsConst.SIGN_KEY);
    }

    public Map<String, Object> getData() {
        return MapUtils.getMap(this, DATA_KEY, new HashMap<String, Object>());
    }

    public int getCode() {
        return MapUtils.getIntValue(getData(), YsConst.CODE_KEY);
    }

    public String getMsg() {
        return MapUtils.getString(getData(), YsConst.MSG_KEY);
    }

    public String getSubCode() {
        return MapUtils.getString(getData(), YsConst.SUB_CODE_KEY);
    }

    public String getSubMsg() {
        return MapUtils.getString(getData(), YsConst.SUB_MSG_KEY);
    }

    public String getToken() {
        return MapUtils.getString(getData(), TOKEN_KEY);
    }

    public String getTokenStatus() {
        return MapUtils.getString(getData(), TOKEN_STATUS_KEY);
    }
}
